package com.rfid.spec;

import java.util.Vector;

public class L0_RFID {
    private Vector<L0_APL> m_aplList = new Vector();

    public void RegisterAPL(L0_APL apl) {
        if (apl == null) return;
        int i = 0;
        for (i = 0; i < this.m_aplList.size(); i++) {
            L0_APL p = (L0_APL) this.m_aplList.get(i);
            if (p != null && p.GetId() == apl.GetId()) break;
        }
        if (i >= this.m_aplList.size()) this.m_aplList.add(apl);
    }

    L0_APL GetAPLByIndex(long index) {
        if (index >= this.m_aplList.size()) return null;
        return (L0_APL) this.m_aplList.get((int) index);
    }

    public L0_APL GetAPL(long Id) {
        int i = 0;
        for (i = 0; i < this.m_aplList.size(); i++) {
            L0_APL p = (L0_APL) this.m_aplList.get(i);
            if (p != null && p.GetId() == Id) return p;
        }
        return null;
    }

    public L0_APL GetAPLByHardID(long hardID) {
        for (int i = 0; i < this.m_aplList.size(); i++) {
            L0_APL p = (L0_APL) this.m_aplList.get(i);
            if (p != null && p.GetHardId() == hardID) return p;
        }
        return null;
    }

    public void ReleaseRegisAPL() {
        this.m_aplList.clear();
    }
}
